package com.book.bridge.function.impl;

import com.book.bridge.function.AbstractRegisterLoginFunc;
import com.book.bridge.function.RegisterLoginFunctionInterface;
import com.book.pojo.UserInfo;
import com.book.repo.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * @param
 * @author oyz
 * @version 1.0.4
 * @description: 接口的默认实现
 * @date 2023/10/31 21:19
 */
@Component
public class RegisterLoginDefault extends AbstractRegisterLoginFunc implements RegisterLoginFunctionInterface {

    @Autowired
    private UserRepository repository;

    @Override
    public String login(String account, String password) {

        return commonLogin(account, password,repository);
    }

    @Override
    public String register(UserInfo info) {

        return commonRegister(info,repository);
    }

    @Override
    public boolean checkUserExists(String userName) {

        return commoncheckUserExists(userName,repository);
    }


}
